
function [ ] = TestRainbow(  )
dataFile = 'SimpleCloth.mat';
name = 'SimpleCloth';
% Modify matlab path
addpath(genpath('../util')); addpath(genpath('../io')); addpath(genpath('../strain'));
addpath(genpath('../export')); addpath(genpath('../obj-tools')); addpath(genpath('../preprocess'));
addpath(genpath('..')); addpath( genpath('../cloth') ); addpath( genpath ('../scalar-field') );
addpath( genpath('../neighborhood') );

resDir = 'res/';
% Load data
data = load( [resDir dataFile] );

[numberOfFrames, nV] = size(data.frames);
nV = nV / 3;
vertices = toMatrix(data.frames(1,:));
obj_ref.vertices = vertices;
obj_ref.faces = data.topology;
nF = size(data.topology, 1);

obj_ref.nF = nF;
obj_ref.nV = nV;

% default initialization to zeroes
sfMinGlobal = zeros(obj_ref.nV, 1);
sfMaxGlobal = zeros(obj_ref.nV, 1);
sfMeanGlobal = zeros(obj_ref.nV, 1);

% compute adjacency lists
% List of faces adjacent to each vertex
 TestAnimatedMesh( [resDir name] );

% Load Adj list
hmm = load( [resDir name 'Adj.mat'] );
adjList = hmm.adjList;
adjVertList = hmm.adjVertList;
% Load dist matrix
distMatrix = load( [resDir name 'DistMatrix.mat'] );
distMatrix = distMatrix.distMatrix;



% SAVE RESULTS
outDir = 'target/';

LOG('Exporting... sfMax');
indeces = (1:nV)';
field = linspace(0,1, nV)';
field(:,2) = indeces;
field = sortrows(field,1);
colorList = rainbow( nV );
colorList(:,4) = field(:,2);
colorList = sortrows(colorList, 4);

%vertexColorList = createColorInfo(allVertices, sfMax, h);
path = getExportFileName(outDir, name, exportFileType.kSFMin);
exportPLY( path, obj_ref.vertices, colorList, obj_ref.faces);

%{
saveResultsOfTemporalIntegration(outDir, name, sfMinGlobal, sfMaxGlobal, sfMeanGlobal, hSF, obj_ref, adjVertList);
%}

end % function 